package com.dragons.dragonsvf.entities;

import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.sql.Timestamp;

/**
 * @author dragons
 * @version 1.0.0
 * @description: 用户信息类
 * @date 2025/2/6 14:52
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@TableName("user_info")
public class UserInfo {

    private String id; // 唯一的32位的
    @TableField(value = "username", condition = SqlCondition.LIKE)
    private String username; // 用户名
    @TableField(value = "across_num", condition = SqlCondition.EQUAL)
    private String across_num; // 密码
    @TableField(value = "encrypt_pwd", condition = SqlCondition.EQUAL)
    private String encrypt_pwd; // 加密后的密码
    @TableField(value = "encryption_algorithm", condition = SqlCondition.EQUAL)
    private String encryption_algorithm; // 加密算法
    @TableField(value = "email", condition = SqlCondition.LIKE)
    private String email; // 电子邮件
    @TableField(value = "tel_num", condition = SqlCondition.LIKE)
    private String tel_num; // 电话号码
    @TableField(value = "wechat_abt", condition = SqlCondition.LIKE)
    private String wechat_abt; // 微信相关信息
    @TableField(value = "avatar_url", condition = SqlCondition.LIKE)
    private String avatar_url; // 头像minio链接
    @TableField(value = "role_num", condition = SqlCondition.EQUAL)
    private String role_num; // 角色编号
    @TableField(value = "freeze_ornnt", condition = SqlCondition.EQUAL)
    private String freeze_ornnt; // 是否冻结 0 不冻结 1 冻结
    @TableField(value = "create_tm", condition = SqlCondition.LIKE)
    private Timestamp create_tm; // 创建时间 timestamp格式
    @TableField(value = "update_tm", condition = SqlCondition.LIKE)
    private Timestamp update_tm; // 最新修改时间timestamp格式
    @TableField(value = "account_money", condition = SqlCondition.EQUAL)
    private Integer account_money; // 账户金额
    @TableField(value = "b_account", condition = SqlCondition.EQUAL)
    private Double b_account; // 账户金额

//    @TableField(exist = false)  // 头像base64编码（非数据库字段）
//    private String avatarBase64; // 头像base64编码
    // 或者通过 Java 关键字或静态声明实现自动忽略：声明为 static 或 transient
    //优点： 全局唯一性，避免数据冗余	缺点：不符合实例字段设计原则
    //private static String avatarBase64;
    //优点：无需依赖注解，原生支持	缺点：可能影响序列化逻辑
    //private transient String avatarBase64;

}
